package com.zhuzg.pojo.request;

import com.zhuzg.vlidat.GroupAdd;
import com.zhuzg.vlidat.GroupUpdate;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.*;
import java.util.Date;
import java.util.List;

/**
 *
 */
@Data
public class StorageInRequestDto {

    @NotNull(groups = {GroupUpdate.class},message = "hi，修改的时候必须有id")
    @Null(groups = {GroupAdd.class},message = "添加的时候不能有id！！！")
    private Integer id;


    @NotNull
    @Length(max=20,min=5,groups = {GroupAdd.class,GroupUpdate.class})
    private String InNo;


    @Min(value = 10,message = "仓库id必须大于10",groups = {GroupAdd.class,GroupUpdate.class})  // 数值的限制
    private Integer storageId;


    //@Pattern()
    private String descs;


    /**
     * 入库的条目
     */
    @NotEmpty
    @Size(min = 1,message = "必须得有入库的数据",groups = {GroupAdd.class,GroupUpdate.class})
    private List<StorageInItem> itemList;

    @Past(groups = {GroupAdd.class,GroupUpdate.class}) // 必须是过去的日期
    private Date productDate;


    @Future(message = "过期时间不能小于当前的时间",groups = {GroupAdd.class,GroupUpdate.class})  // 必须是将来的日期
    private Date expireDate;





}
